package com.ruoyi.web.controller.admin;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.BdmOrder;
import com.ruoyi.system.service.IBdmPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/bdmPay")
public class BdmPayController {

    @Autowired
    private IBdmPayService bdmPayService;

    @GetMapping("/selectPay")
    public AjaxResult selectPay(String id){
        BdmOrder bdmOrder = new BdmOrder();
        bdmOrder.setId(id);
        return AjaxResult.success(bdmPayService.selectPay1(bdmOrder));
    }

    @PostMapping("/getMD5Sign")
    public AjaxResult getMD5Sign(@RequestBody Map<String,String> map){
        Map<String,String> map1= bdmPayService.getMD5Sign(map);
        return AjaxResult.success(JSON.toJSONString(map1));
    }

    @PostMapping("/getMD5Sign1")
    public AjaxResult getMD5Sign1(@RequestBody BdmOrder bdmOrder){
        Map<String,Object> map1= bdmPayService.getPaySigninfo(bdmOrder);
        return AjaxResult.success(map1);
    }

    @PostMapping("/getChargeMD5Sign")
    public AjaxResult getChargeMD5Sign(@RequestBody BdmOrder bdmOrder){
        Map<String,Object> map1= bdmPayService.getChargeMD5Sign(bdmOrder);
        return AjaxResult.success(map1);
    }
}
